<!--  таблица корневых каталогов -->

<?php use_helper('Form');?>
<div style="padding-left: <?php echo $cur_f->getLevel()*10?>px;">
<?php use_helper('Javascript') ?>
           <div id="<?php echo $module?>close_folder_indicator_<?php echo $cur_f->getId() ?>" style="display: none">
			<?php echo image_tag('/images/indicator.gif') ?>&nbsp;&nbsp;<font color="red"><?php echo __('закрываю')?>...</font>
			</div>

        <?php $cur_filter = sfContext::getInstance()->getUser()->getAttribute('material.filters_folder'); ?>
		
		<?php 
		  if (@in_array($cur_f->getId(),$cur_filter))
		  {
		  	$class="punkt curent";
		  }
		  else 
		  {
		  	$class="punkt";
		  }
		?>

        <div class="floatleft">
        <?php 
	                echo link_to_remote(FolderPeer::getFolderIcon($cur_f,'open'), array(
				    'update' => $module.'dir_'.$cur_f->getId(),
	                'script'=>'true',
				    'url'    => 'zdFolder/close_folder?mod='.$module.'&id='.$cur_f->getId().'&width_check='.@$width_check,
				    'loading'  => "Element.show('".$module."close_folder_indicator_".$cur_f->getId()."')",
				    'complete' => "Element.hide('".$module."close_folder_indicator_".$cur_f->getId()."')"  
				    ),'style="background: none" class="marker"');
	                ?>			
        </div>
      
         <?php if(@$width_check=='yes'):?>
             <?php if (isset($arr)):?> 		
			  		<?php if(in_array($cur_f->getId(),@$arr)):?>
					<?php echo image_tag('/images/icons/checkbox.gif')?>
					<?php else: ?>
					<?php echo checkbox_tag('material[mat2_folder_list][]',$cur_f->getId(),null,'id= "'.$cur_f->getId().'" checked=checked style="float:left"');?>
		            <?php endif ?>	  
	            <?php else: ?>
	                <?php echo checkbox_tag('material[mat2_folder_list][]',$cur_f->getId(),null,'id= "'.$cur_f->getId().'" checked=checked style="float:left"');?>
	            <?php endif ?>	            
	                
          <label for="<?php echo $cur_f->getId()?>"><?php echo $cur_f ?></label> 
        <?php else:?>
		   <?php echo link_to($cur_f, 'catalog/index?folder_id='.$cur_f->getId(),'style="padding-left: 18px"') ?>	    
        <?php endif ?>
        
       
          <div class="clear"></div>
		<?php foreach($folders as $f): ?>
		<?php include_partial('zdFolder/item',array('arr'=>@$arr,'f'=>$f,'width_check'=>@$width_check, 'module'=>$module))?>
		<?php endforeach?>
		
 </div>